<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2019/4/28
 * Time: 10:45
 */
namespace Modules\Admin\Main\Controllers;
use App\Http\Controllers\Controller;
use App\Models\ExchangeRecord;
use Illuminate\Http\Request;

class MayController extends Controller{
    public function search(){
        return view("main::maylist",\Request::all());
    }

    public function apiSearch(Request $request){
        $limit = $request->input('limit', 10); // 这个是接受参数
        $offset = $request->input('offset', 0);
        $data['total'] = ExchangeRecord::query()->count();
        $data['items'] =  ExchangeRecord::query()->take($limit)
            ->skip($offset)
            ->orderBy('id', 'desc')
            ->get();

        return success($data);
    }
}